package com.example.fashionshoes.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.fashionshoes.pojo.po.Coupon;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CouponMapper extends BaseMapper<Coupon> {
    /**
     * 获取在售优惠劵
     * @return 在售优惠劵
     */
    @Select("select * from coupon where remaining>0 and start_time+duration >=now()")
    List<Coupon> getCoupon();
}
